<template>
  <div class="warp">
    <div class="header"></div>
    <div class="title">资格检查</div>
    <div class="main-list">
      <div class="main-item">
        <div class="main-item-lable">申请人</div>
        <input class="main-item-input" type="text" v-model="dataForm.name" />
      </div>
      <div class="main-item">
        <div class="main-item-lable">身份证号码</div>
        <input class="main-item-input" v-model="dataForm.idCard" type="text" />
      </div>
    </div>
    <div class="footer">
      <div class="footer-btn" @click="saveForm">提交申请</div>
      <div class="footer-btn" @click="saveForm1">提交申请1</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'home',
  data () {
    return {
      dataForm: {
        name: '',
        idCard: ''
      }
    }
  },
  methods: {
    saveForm () {
      if (!this.dataForm.name || !this.dataForm.idCard) {
        this.$toast('申请人或身份证号码不能为空')
      } else {
        console.log(JSON.stringify(this.dataForm))
        this.$router.push({
          path: 'applicantInfo',
          query: {
            name: this.dataForm.name,
            idCard: this.dataForm.idCard
          }
        })
      }
    },
    saveForm1 () {
      if (!this.dataForm.name || !this.dataForm.idCard) {
        this.$toast('申请人或身份证号码不能为空')
      } else {
        console.log(JSON.stringify(this.dataForm))
        this.$router.push({
          path: 'publicHouse',
          query: {
            name: this.dataForm.name,
            idCard: this.dataForm.idCard
          }
        })
      }
    }
  }
}
</script>

<style lang="stylus" scoped></style>
